package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * ClassName: OrderSubmitMapper
 * Description: com.sky.mapper
 */
@Mapper
public interface OrderSubmitMapper {

    /**
     * 向订单详细表中批量插入数据
     * @param orderDetailList
     */
    void insertBatch(List<OrderDetail> orderDetailList);

    /**
     * 查询订单明细
     * @param orderId
     * @return
     */
    @Select("select * from order_detail where order_id = #{orderId}")
    List<OrderDetail> getByOrderId(Long orderId);

    /**
     * 获取菜品名字，统计top10销量
     * @param id
     * @return
     */
    @Select("select name from order_detail where order_id = #{id} ")
    List<String> getName(Integer id);
}
